package it.fuzzylogics.fuzzywidgetsLibrary.client.FuzzyResizableCell;


public class BezierGenerator3 {

    private XY _a = new XY();
    private XY _t = new XY();
    private XY _b = new XY();

    public BezierGenerator3(XY a, XY t, XY b) {
        _a.setValue(a);
        _t.setValue(t);
        _b.setValue(b);
    }

    private double tween(double a, double b, double k) {
        return ((a * (1 - k)) + (b * k));
    }

    public XY getPosition(double i) {
        double tx;
        double ty;
        tx = tween(_a.x, _t.x, i);
        ty = tween(_a.y, _t.y, i);
        return new XY(tween(tx, _b.x, i), tween(ty, _b.y, i));
    }
}